
kmpkg_from_gitee(
    OUT_SOURCE_PATH SOURCE_PATH
    REPO kumose/glog
    REF v${VERSION}
    SHA512 06563b2fecc0a00eacb2e28f7cde727754ff0b1568371cfaa45905aa8c391149d75c3fd3d2acce9bf2d2bedbcfee06955ad84d530adb44c8e794a80890915186
    HEAD_REF master
)


kmpkg_check_features(
    OUT_FEATURE_OPTIONS FEATURE_OPTIONS
    FEATURES
        unwind          WITH_UNWIND
        customprefix    WITH_CUSTOM_PREFIX
    INVERTED_FEATURES
        unwind          CMAKE_DISABLE_FIND_PACKAGE_Unwind
)

kmpkg_cmake_configure(
    SOURCE_PATH "${SOURCE_PATH}"
    OPTIONS
        -DBUILD_TESTING=OFF
        ${FEATURE_OPTIONS}
)

kmpkg_cmake_install()
kmpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/glog)

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

kmpkg_copy_pdbs()

kmpkg_fixup_pkgconfig()


if("unwind" IN_LIST FEATURES)
    file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/kmpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
endif()

kmpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
